import request from '@/utils/request'

export function orderAdd(data) {
  return request({
    url: '/order/add',
    method: 'post',
    data
  })
}
export function getMaterial(query) {
  return request({
    url: '/mopProductinfo/query',
    method: 'get',
    params: query
  })
}
export function addPage() {
  return request({
    url: '/order/addPage',
    method: 'get'

  })
}
export function getTurns(query) {
  return request({
    url: '/order/getTurns',
    method: 'get',
    params: query
  })
}
export function addDetail(data) {
  return request({
    url: '/order/addDetail',
    method: 'post',
    params: data
  })
}
export function query(data) {
  return request({
    url: '/order/page',
    method: 'get',
    params: data
  })
}
export function queryback(data) {
  return request({
    url: '/order/check/page',
    method: 'get',
    params: data
  })
}
export function toVoid(id, type) {
  return request({
    url: `/mes/productionplan/updateStatus/${id}`,
    method: 'put'
  })
}
export function hezhun(data) {
  return request({
    url: `/order/checkStatus`,
    method: 'put',
    params: data
  })
}
export function fhezhunBack(data) {
  return request({
    url: `/order/returnCheck`,
    method: 'put',
    params: data
  })
}
export function queryDetails(qurey) {
  return request({
    url: '/order/queryDetails',
    method: 'get',
    params: qurey
  })
}

export function weekToDanChaiFen(id) {
  return request({
    url: `/mes/productionplan/week/chaiFen/page/${id}`,
    method: 'get'
    // params: qurey
  })
}
export function goBack(data) {
  return request({
    url: `/order/goBack`,
    method: 'put',
    params: data
  })
}
export function check(data) {
  return request({
    url: '/order/goBack/check/',
    method: 'put',
    data
  })
}
export function downAll(data) {
  return request({
    url: `/order/doExport`,
    responseType: 'arraybuffer',
    method: 'get',
    params: data
  })
}
export function submitApply(data) {
  return request({
    url: '/wms/store-in-apply/saveProduct',
    method: 'post',
    data
  })
}
export function checkContent(data) {
  return request({
    url: '/mes/quality/checkContent',
    method: 'get',
    params: data
  })
}
export function getorderInfor(data) {
  return request({
    url: '/order/getmsgByNo',
    method: 'get',
    params: data
  })
}
export function addFMopOrder(data) {
  return request({
    url: '/production_plan/addFMopOrder',
    method: 'post',
    data
  })
}
export function fMopOrder(data) {
  return request({
    url: '/production_plan/fMopOrder',
    method: 'get',
    params: data
  })
}
export function delVoid(id) {
  return request({
    url: `/order/delete?ids=${id}`,
    method: 'delete'
  })
}
export function insertIntoOrderQualityReport(data) {
  return request({
    url: '/mes/quality/insertIntoOrderQualityReport',
    method: 'post',
    data
  })
}
export function updateMopOrder(data) {
  return request({
    url: '/production_plan/updateFMopOrder',
    method: 'post',
    data
  })
}
export function orderlingliao(id) {
  return request({
    url: '/yxk/orderlingliao/' + id,
    method: 'get'

  })
}
